// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import router from './router'
import ElementUI from 'element-ui'
import App from '@/App'
import stores from '@/store/index.js'
import 'element-ui/lib/theme-chalk/index.css'
import 'common/stylus/index.styl' //全局引入公共样式
import axios from  './api/http'   //引入封装好的axios请求JS
import {getToken,Error, Success} from './common/js/uilt'
import * as filters from './common/js/filters'
import './api'        // 接口
import config from './config'
import './common/js/setRem.js'


Vue.prototype.$config = config
// 注册全局的过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

//将axios挂载到prototype上，那么组件就可以直接使用this.axios使用
Vue.prototype.$axios = axios;
Vue.use(ElementUI);
Vue.config.productionTip = false;
Vue.config.debug = true;

// 设置全局的消息提示框
Vue.prototype.$error = Error;
Vue.prototype.$success = Success;

/* eslint-disable no-new */
new Vue({
  store: stores,
  router,
  render: h => h(App)
}).$mount('#app-box')
